#include<stdio.h>
int main()
{
    int Aa,Ab;
    scanf("%d %d",&Aa,&Ab);
    int arr[3]={0};
    int i = 0;
    int Ja = 0;
    int Jb = 0;
    for(i=0;i<3;i++)
    {
        scanf("%d",&arr[i]);
        if(arr[i]==0)
        {
            Ja++;
        }
        else
        {
            Jb++;
        }
    }
    if((Aa>Ab&&Ja>0)||Ja==3)
    {
        printf("The winner is a: %d + %d",Aa,Ja);
    }
    else if((Ab>Aa&&Jb>0)||Jb==3)
    {
        printf("The winner is b: %d + %d",Ab,Jb);
    }
    return 0;
}